package icu.zhhll.datasource.dynamic;

import java.util.List;
import java.util.Map;

/**
 * @author zh
 * @date 2023/10/7 16:51
 */
public class DynamicProperties {
    private List<RealDataSource> dataSources;
    private String defaultDS;

    public List<RealDataSource> getDataSources() {
        return dataSources;
    }

    public void setDataSources(List<RealDataSource> dataSources) {
        this.dataSources = dataSources;
    }

    public String getDefaultDS() {
        return defaultDS;
    }

    public void setDefaultDS(String defaultDS) {
        this.defaultDS = defaultDS;
    }

    /**
     * 真实数据源
     */
    public static class RealDataSource {
        private String name;
        private String driverClassName;
        private String url;
        private String username;
        private String password;
        // 数据库连接池的类型(使用全类名)
        private String type;
        // 针对不同线程池特有的属性
//        private Properties extraProps;
        private Map<String, Object> extraProps;


        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getDriverClassName() {
            return driverClassName;
        }

        public void setDriverClassName(String driverClassName) {
            this.driverClassName = driverClassName;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public String getPassword() {
            return password;
        }

        public void setPassword(String password) {
            this.password = password;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public Map<String, Object> getExtraProps() {
            return extraProps;
        }

        public void setExtraProps(Map<String, Object> extraProps) {
            this.extraProps = extraProps;
        }
    }
}
